/*
 * @Author: your name
 * @Date: 2021-07-30 15:57:38
 * @LastEditTime: 2021-11-05 14:41:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \jinfeng_up\src\API\tasks\server.js
 */
import Api from './api.js'
import request from '@/utils/request'
import fileDownload from '@/utils/fileDownload.js'

export const taskPandect = {
    GetTaskPageList(_data) {
        return request.post(Api.GetTaskPageList, _data)
    },
    GetTaskAgentPageList(_data) {
        return request.post(Api.GetTaskAgentPageList, _data)
    },

    /* 我的代办  超期任务 */

    GetTaskAgency(serious) {
        return request.get(Api.GetTaskAgency + serious)
    },

    CloseTask(_data, _id) {
        return request.post(Api.CloseTask + _id, _data)
    },
    Activation(_data, _id) {
        return request.post(Api.Activation + _id, _data)
    },
    GetProductIdByFeedId(_id) {
        return request.get(Api.GetProductIdByFeedId + _id)
    },

    ExportAgentLog(_data) {
        fileDownload.fileDownload('POST', Api.ExportAgentLog, _data)
    },
    CreateTask(_data) {
        return request.post(Api.CreateTask, _data)
    },
    ConfirmTask(_id) {
        return request.post(Api.ConfirmTask + _id)
    },
    UpdateProcess(_data, _id) {
        return request.post(Api.UpdateProcess + _id, _data)
    },
    TransferTask(_data, _id, _uid) {
        return request.post(Api.TransferTask + _id + '/' + _uid, _data)
    },
    ExportAsync(_data) {
        fileDownload.fileDownload('POST', Api.ExportAsync, _data)
    },
    GetInfoByIdAsync(_id) {
        return request.get(Api.GetInfoByIdAsync + _id)
    },
    GetTaskCloseReason() {
        return request.get(Api.GetTaskCloseReason)
    },
    FeedBackTurnToTheTask(_data) {
        return request.post(Api.FeedBackTurnToTheTask, _data)
    },

    ExportTaskAgency(_data, _filename) {
        fileDownload.fileDownload('POST', Api.ExportTaskAgency, _data, _filename)
    },

    ExportFeedBackAgency(_data, _filename) {
        fileDownload.fileDownload('POST', Api.ExportFeedBackAgency, _data, _filename)
    }
}
